package com.example.terminalservice.mapper;

import com.example.terminalservice.pojo.UserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 28142
* @description 针对表【sys_user_role】的数据库操作Mapper
* @createDate 2023-08-05 09:42:50
* @Entity com.example.terminalservice.pojo.UserRole
*/
public interface UserRoleMapper extends BaseMapper<UserRole> {
    /**
     * 批量插入
     * @author 杨雨盛
     * @date 2023/8/6 10:18
     * @param userId
     * @param ids
     * @return int
     */
    int insertBatch(@Param("userId") Integer userId,
                    @Param("ids")List<Integer> ids);

    /**
     * 批量删除
     * @author 杨雨盛
     * @date 2023/8/6 10:18
     * @param userId
     * @param ids
     * @return int
     */
    int deleteBatch(@Param("userId") Integer userId,
                    @Param("ids") List<Integer> ids);

    /**
     * 根据userId删除用户角色关联表的所有对应数据
     * @author 杨雨盛
     * @date 2023/8/6 23:14
     * @param userId
     * @return int
     */
    int deleteByUserId(Integer userId);
}




